using Godot.Collections;

public class SteamCrusherBlockEntity : BlockEntity
{
    public Store store = new Store(2);
    public int Pace = 0;
    public const int MaxPace = 100;
    public FluidData steam = new FluidData("steam", 0, 16000);
    public override Dictionary getDict()
    {
        Dictionary dict = new Dictionary
        {
            { "store", store.getDict() },
            { "steam", steam.GetDictionary() },
            { "pace", Pace },
            { "tick", tick }
        };
        return dict;
    }
    public override BlockEntity JsonTo(Dictionary dict)
    {
        if (dict.Contains("store")) this.store.JsonTo((Dictionary)dict["store"]);
        steam.Parse((Dictionary)dict["steam"]);
        tick = dict["tick"].ToInt();
        Pace = dict["pace"].ToInt();
        return this;
    }
    public override Store GetStore()
    {
        return store;
    }
    public override FluidData GetFluid(int index)
    {
        if(index==0)return steam;
        return null;
    }
    public override FluidData GetFluid(string name)
    {
        if(name=="steam")return steam;
        return null;
    }
}